*------------------------------------------Reproduction files for------------------------------------------------*
*                                   Laustsen 2017: Choosing the Right Candidate:
* Observational and Experimental Evidence that Conservatives and Liberals Prefer Powerful and Warm Candidate Personalities, Respectively
*                                                    Political Behavior

*************************************************Study 2: US experiment**************************************************


*---------------------------------------------Crates and recodes variables----------------------------------------------*


***Creates experimental conditions for personality description of the fictitious candidate, Christian Mortensen:
generate personality =.
replace personality = 1 if q1c==1
replace personality = 0 if q1d==1
label define personalityLB 0 "Powerful" 1 "Warm"
label values personality personalityLB


****Dependent variables
***Creates feeling thermometer ratings of the fictitious candidate, Thomas Johnson
recode q2c (997=.)
recode q2d (997=.)
egen feelings100 = rowmean(q2c q2d)
generate feelings = feelings100/100

***Creates variable for likelihood to vote for the fictitious candidate, Thomas Johnson
egen likelihood_vote10 = rowmean(q3c_1 q3d_1)
generate likelihood_vote = likelihood_vote10/10


**** Moderators
***Creates ideology (7 point scale) variable coded to 0-1 scale on which "0" = most liberal position; "1" most conservative position
recode q1 (1=0) (2=1) (3=2) (4=3) (5=4) (6=5) (7=6) (else=.), generate(lib_cons7)
generate ideology = lib_cons7/6
summ ideology

***Creates party affiliation variable (7 point scale) coded to 0-1 scale on which "0" = strong democrat; "1" = strong republican
recode q3 (1=0) (2=1) (3=2) (4=3) (5=4) (6=5) (7=6) (else=.), generate(demo_rep7)
generate party_affiliation = demo_rep7/6
summ party_affiliation

*Authoritarianism
*independence vs. respect for elders
recode q5 (1=1) (2=2) (3=3) (else=.), generate(autho1)

*curiosity vs. good manners
recode q6 (1=1) (2=2) (3=3) (else=.), generate(autho2)

*obedience vs. self-reliance
recode q8 (1=3) (2=2) (3=1) (else=.), generate(autho3)

*being considerate vs. well behaved
recode q9 (1=1) (2=2) (3=3) (else=.), generate(autho4)

*Sumindeks
generate authoritarianism = (autho1+autho2+autho3+autho4-4)/8
alpha autho1 autho2 autho3 autho4
summ authoritarianism


**** Creates trait ratings of the two personality descriptions on 0-1 scale on which "0" and "1" srae min. and max. values.
*Agreableness
recode q1c_1 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(agree1)
recode q1d_1 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(agree2)
egen agreeableness7 = rowmean (agree1 agree2)
generate agreeableness = agreeableness7/7

*Strong leadership
recode q1c_2 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(strong_leadership1)
recode q1d_2 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(strong_leadership2)
egen strong_leadership7 = rowmean (strong_leadership1 strong_leadership2)
generate strong_leadership = strong_leadership7/7

*Care about other people
recode q1c_3 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(care_about1)
recode q1d_3 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(care_about2)
egen care_about_others7 = rowmean (care_about1 care_about2)
generate care_about = care_about_others7/7

*Dominant
recode q1c_4 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(domi1)
recode q1d_4 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(domi2)
egen dominant7 = rowmean (domi1 domi2)
generate dominant = dominant7/7

*Friendly
recode q1c_5 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(friend1)
recode q1d_5 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(friend2)
egen friendliness7 = rowmean (friend1 friend2)
generate friendliness = friendliness7/7

*Competitive
recode q1c_6 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(compi1)
recode q1d_6 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(compi2)
egen competitiveness7 = rowmean (compi1 compi2)
generate competitiveness = competitiveness7/7

*Kompetence
recode q1c_7 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(comp1)
recode q1d_7 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1), generate(comp2)
egen competent7 = rowmean (comp1 comp2)
generate competent = competent7/7


**** Background variables
***Creates variable for subject gender ("0" = female; "1" = male).
recode gender (1=1) (2=0)
label define genderLB 0 "female" 1 "male"
label values gender genderLB
tab gender

***Creates variable for subject age
generate age = 2013-birthyr
summ age

***Creates variable for subject race
tab race

***Creates variable for subjects' level of education
tab educ, generate(education)



*---------------------------------------Correlation between trait ratings (reported in note 13)-------------------------------------------*
*Correlations between traits related to Warmth
pwcorr agreeableness care_about friendliness, sig

*Correlations between traits related to Power
pwcorr dominant strong_leadership competitiveness, sig



*---------------------------Manipulation checks in perceptions of the two personality descriptions---------------------------------------*
** Perceived agreeableness
ttest agreeableness, by(personality)

** Perceived dominance
ttest dominant, by(personality)


*---------------------Interaction between personality description (Warm versus Powerful) and ideology-------------------------------------*
** DV = feeling thermometer (Model reported in Table 2, Model A)
reg feelings i.personality##c.ideology

margins, dydx(ideology) over(personality)

*Figure 2, panel A:
marginsplot, recastci(rcap) ciopts(lpattern(dash)) recast(bar) yline(0) xlabel(#2) ///
xtitle(Personality description) ytitle(Marg. effect of ideology on Feelings (US)) title("") scheme(s2color)


** DV = likelihood to vote for Thomas Johnson (Model reported in Table 2, Model B)
reg likelihood_vote i.personality##c.ideology

margins, dydx(ideology) over(personality)

*Figure 2, panel B:
marginsplot, recastci(rcap) ciopts(lpattern(dash)) recast(bar) yline(0) xlabel(#2) ///
xtitle(Personality description) ytitle(Marg. effect of ideology on likely to vote for (US)) title("") scheme(s2color)


*** Models also controlling for rival interaction between personality description and party affiliation
** DV = feeling thermometer (Full model reported in Online Supplementary Material S.9 Table S.9.1,, Model A)
reg feelings i.personality##c.ideology i.personality##c.party_affiliation

margins, dydx(ideology) over(personality)


** DV = likelihood to vote for Thomas Johnson (Full model reported in Online Supplementary Material S.9 Table S.9.1, Model B)
reg likelihood_vote i.personality##c.ideology i.personality##c.party_affiliation

margins, dydx(ideology) over(personality)



*------------------------Does authoritarianism drive the ideologically different preferences for warm and powerful candidates?-----------*
** Correlation between authoritarianism and ideology (reported in Discussion section for Study 2)
pwcorr authoritarianism ideology, sig


*** Interactions between authoritarianism and personality description (reported in Discussion section for Study 2)
** DV = feeling thermometer (Full model reported in Online Supplementary Material S.10 Table S.10.1,, Model A)
reg feelings i.personality##c.authoritarianism

margins, dydx(authoritarianism) over(personality)


** DV = likelihood to vote for Thomas Johnson (Full model reported in Online Supplementary Material S.10 Table S.10.1,, Model B)
reg likelihood_vote i.personality##c.authoritarianism

margins, dydx(authoritarianism) over(personality)



*** Models estimating the simultaneous interactiosn between ideology and authoritarianism, resepctively, and the personality description
** DV = feeling thermometer (Full model reported in Online Supplementary Material S.10 Table S.10.2,, Model A)
reg feelings i.personality##c.ideology i.personality##c.authoritarianism

margins, dydx(ideology) over(personality)


** DV = likelihood to vote for Thomas Johnson (Full model reported in Online Supplementary Material S.10 Table S.10.2,, Model B)
reg likelihood_vote i.personality##c.ideology i.personality##c.authoritarianism

margins, dydx(ideology) over(personality)



**** Structural Equation Modelling: Testing if differences in authoritarianism drives the effect of ideology on candidate personality preferences 
*** Using FEELING THERMOMETER ratings as DV

** Analyses for the POWERFUL candidate description:
sem (authoritarianism -> ideology) ///
	(authoritarianism ideology -> feelings) if personality==0, nocapslatent
	
estat teffects
estat gof, stats(all)
//Result: Significant and positive indirect effect of authoritarianism through ideology on the powerfull candidate description.

** Analyses for the WARM candidate description:
sem (authoritarianism -> ideology) ///
	(authoritarianism ideology -> feelings) if personality==1, nocapslatent
	
estat teffects
estat gof, stats(all)
//Result: Significant and negative indirect effect of authoritarianism through ideology on the powerfull candidate description.



*** Replicating results using LIKELIHOOD TO VOTE for Thomas Johnson as DV:
** Analyses for the POWERFUL candidate description:
sem (authoritarianism -> ideology) ///
	(authoritarianism ideology -> likelihood_vote) if personality==0, nocapslatent
	
estat teffects
estat gof, stats(all)
//Result: Significant and positive indirect effect of authoritarianism through ideology on the powerfull candidate description.

** Analyses for the WARM candidate description:
sem (authoritarianism -> ideology) ///
	(authoritarianism ideology -> likelihood_vote) if personality==1, nocapslatent
	
estat teffects
estat gof, stats(all)
//Result: Significant and negative indirect effect of authoritarianism through ideology on the powerfull candidate description.
